import prodEnv from '../../../config/prod.env'
import devEnv from '../../../config/dev.env'
const variables = {
  state: {
    showSettings: true,
    showKeFu: true,
    tagsView: true,
    fixedHeader: true,
    sidebarLogoShow: false,
    sidebarLogoTitle: 'XX查询系统',
    sidebarLogoImg: '/favicon.ico',
    selectYear: '',
    // 注册用户时的初始MD5密码，明码为123456
    defaultPassword: 'e10adc3949ba59abbe56e057f20f883e',
    // 上传资源的OSS地址
    ossUrl: 'http://yuneditor.oss-cn-beijing.aliyuncs.com/',
    // 静态资源服务器路径前缀
    staticUrl: process.env.NODE_ENV === 'production' ? `${prodEnv.BASE_API.replace(/(\"|\')/g, '')}/` : `${devEnv.STATIC_API.replace(/(\"|\')/g, '')}/`,
    localUrl: process.env.NODE_ENV === 'production' ? `${prodEnv.LOCAL_API.replace(/(\"|\')/g, '')}` : `${devEnv.LOCAL_API.replace(/(\"|\')/g, '')}`,
    ueditorHomeUrl: process.env.NODE_ENV === 'production' ? '/admin/static/UEditor/' : '/static/UEditor/',
    // 请求状态错误时返回的错误信息。特殊的请求不使用此错误信息。
    errorMsg: '服务器响应失败，请稍后再试！',
    dashboard: { // Dashboard，位置较多，为方便改动，此处统一配置
      name: 'empty',
      title: '首页' // 本项目暂不使用此值，使用lang中的router.homeName
    },
    nodeStatus: [
      { label: '临时保存', value: 0, type: 'info' },
      { label: '待收', value: 1, type: 'primary' },
      { label: '正在进行', value: 2, type: 'success' },
      { label: '按期完成', value: 3, type: 'info' },
      { label: '逾期进行', value: 4, type: 'danger' },
      { label: '逾期完成', value: 5, type: 'danger' },
      { label: '销项', value: 6, type: 'danger' },
      { label: '部分接收', value: 7, type: 'primary' }
    ],
    nodeProgressStatus: [
      { label: '进展缓慢', value: 0, type: 'danger' },
      { label: '正常推进', value: 1, type: 'info' },
      { label: '进展较快', value: 2, type: 'success' }
    ],
    nodeProgressStatusList: [
      { label: '未审核', value: 0, type: 'info' },
      { label: '审核通过', value: 1, type: 'success' },
      { label: '未通过', value: 2, type: 'danger' },
      { label: '督查室添加', value: 3, type: 'primary' }
    ]

  },
  mutations: {
    CHANGE_SETTING: (state, { key, value }) => {
      if (state.hasOwnProperty(key)) {
        state[key] = value
      }
    }
  },
  actions: {
    changeSetting({ commit }, data) {
      commit('CHANGE_SETTING', data)
    }
  },
  getters: {
    defaultPassword: state => state.defaultPassword,
    sexs: state => state.sexs,
    ossUrl: state => state.ossUrl,
    staticUrl: state => state.staticUrl,
    localUrl: state => state.localUrl,
    ueditorHomeUrl: state => state.ueditorHomeUrl,
    dashboard: state => state.dashboard,
    nodeStatus: state => state.nodeStatus,
    nodeProgressStatus: state => state.nodeProgressStatus,
    nodeProgressStatusList: state => state.nodeProgressStatusList,
    showSettings: state => state.showSettings,
    showKeFu: state => state.showKeFu,
    tagsView: state => state.tagsView,
    fixedHeader: state => state.fixedHeader,
    sidebarLogoShow: state => state.sidebarLogoShow,
    sidebarLogoTitle: state => state.sidebarLogoTitle,
    sidebarLogoImg: state => state.sidebarLogoImg,
    selectYear: state => state.selectYear
  }
}

export default variables
